<?php

/**
 * ProveedorAudit filter form base class.
 *
 * @package    MercaderDigital
 * @subpackage filter
 * @author     Germán Figueredo
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseProveedorAuditFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Proveedor'), 'add_empty' => true)),
      'RazonSocial'   => new sfWidgetFormFilterInput(),
      'email_address' => new sfWidgetFormFilterInput(),
      'TelFijo'       => new sfWidgetFormFilterInput(),
      'TelCel'        => new sfWidgetFormFilterInput(),
      'Calle'         => new sfWidgetFormFilterInput(),
      'Numero'        => new sfWidgetFormFilterInput(),
      'Piso'          => new sfWidgetFormFilterInput(),
      'Dpto'          => new sfWidgetFormFilterInput(),
      'Barrio'        => new sfWidgetFormFilterInput(),
      'Distrito'      => new sfWidgetFormFilterInput(),
      'Detalles'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'CUIT'          => new sfWidgetFormFilterInput(),
      'fechaEvento'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'Evento'        => new sfWidgetFormFilterInput(),
      'id_user_ev'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('UsuarioEvento'), 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Proveedor'), 'column' => 'id')),
      'RazonSocial'   => new sfValidatorPass(array('required' => false)),
      'email_address' => new sfValidatorPass(array('required' => false)),
      'TelFijo'       => new sfValidatorPass(array('required' => false)),
      'TelCel'        => new sfValidatorPass(array('required' => false)),
      'Calle'         => new sfValidatorPass(array('required' => false)),
      'Numero'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'Piso'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'Dpto'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'Barrio'        => new sfValidatorPass(array('required' => false)),
      'Distrito'      => new sfValidatorPass(array('required' => false)),
      'Detalles'      => new sfValidatorPass(array('required' => false)),
      'CUIT'          => new sfValidatorPass(array('required' => false)),
      'fechaEvento'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'Evento'        => new sfValidatorPass(array('required' => false)),
      'id_user_ev'    => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('UsuarioEvento'), 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('proveedor_audit_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ProveedorAudit';
  }

  public function getFields()
  {
    return array(
      'id_Audit'      => 'Text',
      'id'            => 'ForeignKey',
      'RazonSocial'   => 'Text',
      'email_address' => 'Text',
      'TelFijo'       => 'Text',
      'TelCel'        => 'Text',
      'Calle'         => 'Text',
      'Numero'        => 'Number',
      'Piso'          => 'Number',
      'Dpto'          => 'Number',
      'Barrio'        => 'Text',
      'Distrito'      => 'Text',
      'Detalles'      => 'Text',
      'CUIT'          => 'Text',
      'fechaEvento'   => 'Date',
      'Evento'        => 'Text',
      'id_user_ev'    => 'ForeignKey',
    );
  }
}
